@model ShivamEMR.Model.Domain.CRMDomain.Appointment

@* This partial view defines form fields that will appear when creating and editing entities *@

<div class="editor-label">
    @Html.LabelFor(model => model.DateAndTime)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.DateAndTime)
    @Html.ValidationMessageFor(model => model.DateAndTime)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Occation)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Occation)
    @Html.ValidationMessageFor(model => model.Occation)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Priority)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Priority)
    @Html.ValidationMessageFor(model => model.Priority)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Notes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Notes)
    @Html.ValidationMessageFor(model => model.Notes)
</div>

<div class="editor-label">
    Employee
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.EmployeeID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.Employee>)ViewBag.PossibleEmployees).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Title), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.EmployeeID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.EmployeeID)
</div>
<div class="editor-label">
    AppointmentGroup
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.AppointmentGroupID, ((IEnumerable<ShivamEMR.Model.Domain.CRMDomain.AppointmentGroup>)ViewBag.PossibleAppointmentGroups).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.AppointmentGroupID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.AppointmentGroupID)
</div>
<div class="editor-label">
    Venue
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.VenueID, ((IEnumerable<ShivamEMR.Model.Domain.CRMDomain.Venue>)ViewBag.PossibleVenues).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.VenueID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.VenueID)
</div>
<div class="editor-label">
    AppointmentStatus
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.AppointmentStatusID, ((IEnumerable<ShivamEMR.Model.Domain.CRMDomain.AppointmentStatus>)ViewBag.PossibleAppointmentStatus).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.AppointmentStatusID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.AppointmentStatusID)
</div>
